<template>
    <el-select
        :clearable="clearable"
        placeholder="请选择"
        :value="value"
        @change="$emit('input',$event)"
        v-model="value"
    >
        <el-option
            v-for="item in cates"
            :key="item.cate"
            :label="item.cate_zh"
            :value="item.cate"
        ></el-option>
    </el-select>
</template>

<script>
import {mapActions,mapState} from "vuex"
export default {
    name: "CateSelect",
    props:{
        value: {
            type: String,
            default:""
        },
        clearable: {
            type: Boolean,
            default: false
        }
    },
    data() {
        return {
            cates: [{
                cate: '1',
                cate_zh: '苹果手机',
            },{
                cate: '2',
                cate_zh: '华为手机',
            },{
                cate: '3',
                cate_zh: '黑鲨手机',
            },{
                cate: '4',
                cate_zh: 'vivo手机',
            },{
                cate: '5',
                cate_zh: 'oppo手机'
            }]
        }
    },
    computed:{
        // ...mapState("goods",["cates"])
    },
    created(){
        // this.getCates();
    },
    methods: {
        // ...mapActions("goods",["getCates"])
    }
}
</script>

<style>

</style>